package com.huluobo.a2208mdmdemo

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.huluobo.a2208mdmdemo.view.homePage
import com.huluobo.a2208mdmdemo.view.messagePage
import com.huluobo.a2208mdmdemo.view.minePage
import com.huluobo.apps.AppsPage
import com.huluobo.document.view.DocPage
import com.huluobo.document.view.LocalPage
import com.huluobo.lib_base.RoutePath
import com.huluobo.report.view.ReportCommitPage
import com.huluobo.report.view.ReportPage

/**
 *  Created by LC on 2025/1/15.
 */
@Composable
fun MyNavHost(it: PaddingValues, navController: NavHostController) {
    NavHost(
        modifier = Modifier.padding(it),
        navController = navController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { messagePage() }
            composable(RoutePath.HOME) { homePage(navController) }
            composable(RoutePath.MINE) { minePage() }
            composable(RoutePath.APPS) { AppsPage(navController) }
            composable(RoutePath.DOC) { DocPage(navHostController = navController) }
            composable(RoutePath.LOCAL) { LocalPage(navHostController = navController) }
            composable(RoutePath.REPORT) { ReportPage(navHostController = navController) }
            composable(RoutePath.COMMIT_REPORT + "/{report}") {
                val report = it.arguments?.getString("report", "").toString()
                ReportCommitPage(navHostController = navController, report)
            }

        })
}